﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using vantexe_model;
using System.Windows.Forms;

namespace vantexe_view
{
    public partial class PersonSearchResult : Form
    {
        private FindPersonForm findPersonForm;

        public Person SomePerson { get; set; }

        public PersonSearchResult(Person SomePerson)
        {
            this.SomePerson = SomePerson;
            InitializeComponent();
            firstNameTextBox.Text = SomePerson.FirstName;
            lastNameTextBox.Text = SomePerson.LastName;
        }

        private void backToSearchButton_Click(object sender, EventArgs e)
        {
            if (findPersonForm == null)
            {
                findPersonForm = new FindPersonForm();
            }
            findPersonForm.Show();
            this.Hide();
        }

        private void PersonSearchResult_Load(object sender, EventArgs e)
        {
            var x = (FindPersonForm) sender;
            this.findPersonForm = x;
            this.SomePerson = x.SomePerson;
        }
    }
}
